package code1_100.code21_30;

/**
 * @author 韩迪
 * @date 2022/03/28 20:24
 **/
public class Code28 {
    public int strStr(String haystack, String needle) {
        for (int i = 0; i <= haystack.length()-needle.length(); i++) {
            String s = haystack.substring(i,i+needle.length());
            if (s.equals(needle))
                return i;
            
        }
        return -1;
        
    }
}
